---
id: "regular-expression"
keywords: ["regular", "expression", "re"]
name: "%re"
summary: "This is the `regular expression` extension point."
category: "extensionpoints"
status: "deprecated"
---

> Deprecated in favor of native regular expression syntax in v12+

`%re` is used to create JavaScript regular expressions.

<CodeTab labels={["ReScript", "JS Output"]}>

```res
let regex = %re("/^hello/")
let result = regex->Re.test("hello world")
```

```js
var regex = /^hello/;
var result = regex.test("hello world");
```

</CodeTab>

### References

- [Regular Expressions](../docs/manual/primitive-types.mdx#regular-expression)
- [Extension Point Attributes](../docs/manual/attribute.mdx#extension-point)
